layui.use(['form','layer','laydate','table','laytpl'],function(){
    var form = layui.form,
        layer = parent.layer === undefined ? layui.layer : top.layer,
        $ = layui.jquery,
        laydate = layui.laydate,
        laytpl = layui.laytpl,
        table = layui.table;
    //列表
    var tableIns = table.render({
        elem: '#entityList',
        url : '/flowRecord/jsonList',
        cellMinWidth : 95,
        page : true,
        height : "full-125",
        limit : 20,
        method:'post',
        limits : [10,15,20,25],
        id : "entityList",
        cols : [[
            {type: 'numbers', title: '序号'},
            {field: 'activityTitle',minWidth:120, title: '活动名称',align:'center'},
            {field: 'itemTitle',minWidth:120, title: '商品名称',align:'center'},
            {field: 'memberName',minWidth:120, title: '购买人',align:'center'},
            {field: 'flowCount',minWidth:120, title: '购买流量',align:'center'},
            {field: 'createTime',minWidth:170, title: '创建时间', align:'center', templet:function(d){
                return d.createTime;
            }}
        ]]
    });

    //搜索
    $(".search_btn").on("click",function(){
        table.reload("entityList",{
            page: {
                curr: 1 //重新从第 1 页开始
            },
            where: {
                memberName: $("#memberName").val()
            }
        })
    });

})